from PySide6.QtCore import QThread, Signal

class Task(QThread):
    over = Signal()

    def __init__(self, function):
        super().__init__()
        self.function = function  # 存储传入的函数

    def run(self):
        self.function()
        self.over.emit()